package com.heima.Controller;

import com.heima.Service.AdminChannelService;
import com.heima.model.Admin.Dtos.ChannelDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/service_6001/wemedia/api/v1/channel")
public class AdminChannelController {
    @Autowired
    AdminChannelService adminChannelService;

    @GetMapping("/del/{id}")
    public ResponseResult CahnnelDelete(@RequestBody Integer id)
    {
        return adminChannelService.ChannelDelete(id);
    }

    @PostMapping("/list")
    public ResponseResult ChannelList(@RequestBody ChannelDto channelDto)
    {
        return adminChannelService.GetChannelList(channelDto);
    }

    @PostMapping("/save")
    public ResponseResult ChannelSave(@RequestBody WmChannel wmChannel)
    {
        return adminChannelService.ChannelSave(wmChannel);
    }

    @PostMapping("/update")
    public ResponseResult ChannelUpdate(@RequestBody WmChannel wmChannel)
    {
        return adminChannelService.ChannelUpdate(wmChannel);
    }
}
